package com.itheima.service.db.impl;


import com.itheima.domain.db.User;

import com.itheima.mapper.UserMapper;
import com.itheima.service.db.UsersService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class UsersServiceImpl implements UsersService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public Long save(User user) {
        userMapper.insert(user);
        return user.getId();
    }

    @Override
    public void update(User user) {
        userMapper.updateById(user);
    }

    @Override
    public User findById(Long userId) {
        return userMapper.selectById(userId);
    }



}
